#ifndef _N_MESSAGE_H_
#define _N_MESSAGE_H_
#include<iostream>
#include<thread>
#include<string>
#include"level.hpp"
#include "util.hpp"
namespace bitlog
{
    struct logmessage
    {
        time_t _ctime;//日志产生的时间
        Level::value _level;//日志等级
        size_t _line;//日志发生错误的行号
        std::thread::id _tid;//错误产生于哪一个线程
        std::string _file;//源码文件名称
        std::string _logger;//日志器名称
        std::string _payload;//有效消息数据

        logmessage(
            Level::value level,
            size_t line,
            const std::string file,
            const std::string logger,
            const std::string payload
        ):
        _ctime(util::Date::get_time()),
        _level(level),
        _line(line),
        _tid(std::this_thread::get_id()),
        _file(file),
        _logger(logger),
        _payload(payload){}
    };
}
#endif